#include <stdio.h>

//假设密码带空格
int main()
{
        char password[20] = { 0 };
            printf("请输入密码:>");
                scanf("%s",password);
                    
                        int ch = 0;
                            while((ch = getchar()) != '\n'){
                                        ;
                            }//getchar()把空格和后面的都读取了
                                
                                    printf("请确认密码(Y/N):>");
                                        int ret = getchar();
                                            if(ret == Y){
                                                        printf("密码正确\n");
                                            }else{
                                                        printf("密码错误\n");
                                            }
                                                
                                                    return 0;
}
                                            
                                
